﻿Imports System.IO
Imports System.Resources

Public Class frmParamSite

    Dim x As Integer

    Private rm As New ResourceManager(GetType(frmParamSite))

    Private Sub btnAddSite_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddSite.Click
        frmParamNewSite.Show()
    End Sub

    'Chargement de du txtBox par clic sur bouton
    Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click
        Try
            OpenFileDialog1.Filter = "Fichiers texte|*.txt"
            OpenFileDialog1.ShowDialog()
            'récupération de la dernière liste des taxons
            Dim sFilePath = OpenFileDialog1.FileName
            If sFilePath <> "" Then
                Cursor.Current = Cursors.WaitCursor()
                LoadFile(sFilePath, frmEntryChoixSite.lstViewSite)
                ArrangeListView(frmEntryChoixSite.lstViewSite, 1)
                Cursor.Current = Cursors.Default
                MsgBox(DirectCast(My.Resources.Images.alertListLoad & " " & sFilePath, String), MsgBoxStyle.Information, "Pocket eRelevé")
            Else
                MsgBox(DirectCast(My.Resources.Images.alertFileNotSelected, String), MsgBoxStyle.Information, "Pocket eRelevé")
            End If

        Catch Excep As Exception
            Cursor.Current = Cursors.Default
            MsgBox(DirectCast(My.Resources.Images.errorOnLoadFile, String) & Excep.Message, MsgBoxStyle.Exclamation, "Pocket eRelevé")
        End Try
    End Sub

    Private Sub btnMenu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMenu.Click
        Me.Hide()
        FormMain.Show()
    End Sub

    Private Sub btnReturn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReturn.Click
        Me.Hide()
        frmParamChoixList.Show()
    End Sub


End Class